import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryBizPlanMilestone = (params) => {
  params.head.transCode = 'queryBizPlanMilestone';
  return request({
    url: '/biz/plan/bizPlanMilestone/queryBizPlanMilestone',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryBizPlanMilestoneListPage = (params) => {
  params.head.transCode = 'queryBizPlanMilestoneListPage';
  return request({
    url: '/biz/plan/bizPlanMilestone/queryBizPlanMilestoneListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveBizPlanMilestone = (params) => {
  params.head.transCode = 'saveBizPlanMilestone';
  return request({
    url: '/biz/plan/bizPlanMilestone/saveBizPlanMilestone',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveBizPlanMilestoneList = (params) => {
  params.head.transCode = 'saveBizPlanMilestoneList';
  return request({
    url: '/biz/plan/bizPlanMilestone/saveBizPlanMilestoneList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateBizPlanMilestone = (params) => {
  params.head.transCode = 'saveOrUpdateBizPlanMilestone';
  return request({
    url: '/biz/plan/bizPlanMilestone/saveOrUpdateBizPlanMilestone',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateBizPlanMilestoneList = (params) => {
  params.head.transCode = 'saveOrUpdateBizPlanMilestoneList';
  return request({
    url: '/biz/plan/bizPlanMilestone/saveOrUpdateBizPlanMilestoneList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateBizPlanMilestone = (params) => {
  params.head.transCode = 'updateBizPlanMilestone';
  return request({
    url: '/biz/plan/bizPlanMilestone/updateBizPlanMilestone',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteBizPlanMilestone = (params) => {
  params.head.transCode = 'deleteBizPlanMilestone';
  return request({
    url: '/biz/plan/bizPlanMilestone/deleteBizPlanMilestone',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteBizPlanMilestoneList = (params) => {
  params.head.transCode = 'deleteBizPlanMilestoneList';
  return request({
    url: '/biz/plan/bizPlanMilestone/deleteBizPlanMilestoneList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportBizPlanMilestoneExcel = (params) => {
  downloadExcel({
    url: '/biz/plan/bizPlanMilestone/excelDownload/exportBizPlanMilestoneExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
